Method of deriving quantization parameter with differential and predicted quantization parameters

ABSTRACT

A method of inversely quantizing a quantized block is discussed. The method according to an embodiment includes restoring a differential quantization parameter, generating a quantization parameter predictor, generating a quantization parameter using the differential quantization parameter and the quantization parameter predictor, and inversely quantizing the quantized block using the quantization parameter and a quantization matrix.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.14/592,809, filed Jan. 8, 2015, which is a continuation of U.S.application Ser. No. 14/353,891, filed Apr. 24, 2014, which is theNational Stage of PCT Application No. PCT/CN2012/083978, filed Nov. 2,2012, which claims priority of Korean Application No. 10-2011-0114607,filed Nov. 4, 2011. The contents of all these applications areincorporated herein by reference.

BACKGROUND OF THE INVENTION

Technical Field

The present invention relates to a method and an apparatus of deriving aquantization parameter, and more particularly, to a method and apparatusof encoding and decoding a quantization parameter by generating aquantization parameter predictor similar to the quantization parameterusing neighboring quantization parameter.

Background Art

In H.264/MPEG-4 AVC, one picture is divided into macroblocks, therespective macroblocks are encoded by generating a prediction blockusing inter prediction or intra prediction. The difference between anoriginal block and the prediction block is transformed to generate atransformed block, and the transformed block is quantized using aquantization parameter and quantization matrix. The quantizationparameter is adjusted per macroblock and is encoded using a previousquantization parameter as a quantization parameter predictor.

Meanwhile, in HEVC (High Efficiency Video Coding) under construction,various sizes of coding unit are introduced to obtain two times ofcompression efficiency. The coding unit has a role similar to themacroblock of H.264.

But, if the quantization parameter is adjusted per coding unit, thenumber of quantization parameters to be encoded increases as the size ofthe coding unit is smaller. Therefore, adjusting quantization parameterper coding unit results in greater quantity of coding bits required toencode the quantization parameter, which degrades the coding efficiency.Also, because using various sizes of coding unit makes the correlationbetween the quantization parameter and the previous quantizationparameter weaker than that of H.264, a new method of encoding anddecoding the quantization parameter is required for various sizes of thecoding unit.

SUMMARY OF THE INVENTION

The present invention is directed to a method of restoring adifferential quantization parameter of a current coding unit, generatinga quantization parameter predictor of the current coding unit, andgenerating a quantization parameter of the current coding unit using thedifferential quantization parameter and the quantization parameterpredictor.

One aspect of the present invention provides a method of decodingquantization parameter a current coding unit, comprising: restoring adifferential quantization parameter of a current coding unit, generatinga quantization parameter predictor of the current coding unit, andgenerating a quantization parameter of the current coding unit using thedifferential quantization parameter and the quantization parameterpredictor, wherein the quantization parameter predictor is generatedusing one or two quantization parameters of a left quantizationparameter, an above quantization parameter and a previous quantizationparameter.

A method according to an embodiment of the present invention restores adifferential quantization parameter of a current coding unit, generatesa quantization parameter predictor of the current coding unit using oneor two quantization parameters of a left quantization parameter, anabove quantization parameter and a previous quantization parameter, andgenerates a quantization parameter of the current coding unit using thedifferential quantization parameter and the quantization parameterpredictor, wherein a minimum size of quantization unit is adjusted perpicture. Therefore, the complexity of the encoding and decodingapparatus is reduced by adjusting the minimum size of the quantizationunit. Also, coding efficiency is improved by encoding the quantizationparameter using plurality quantization parameters and by signaling theminimum size of the quantization unit per picture.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an image coding apparatus according to anembodiment of the present invention.

FIG. 2 is a conceptual diagram illustrating intra prediction modesaccording to an embodiment of the present invention.

FIG. 3 is a flow chart illustrating a method of encoding quantizationparameter according to an embodiment of the present invention.

FIG. 4 is a block diagram of an image decoding apparatus according to anembodiment of the present invention.

FIG. 5 is a flow chart illustrating a method of decoding a quantizationparameter according to an embodiment of the present invention.

FIG. 6 is a flow chart illustrating a method of generating a predictionblock in intra prediction according to an embodiment of the presentinvention.

FIG. 7 is a flow chart illustrating a procedure of deriving an intraprediction mode according to an embodiment of the present invention.

FIG. 8 is a conceptual diagram illustrating positions of referencepixels of a current block according to an embodiment of the presentinvention.

FIG. 9 is a block diagram illustrating an apparatus of generating aprediction block in intra prediction according to an embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Hereinafter, various embodiments of the present invention will bedescribed in detail with reference to the accompanying drawings.However, the present invention is not limited to the exemplaryembodiments disclosed below, but can be implemented in various types.Therefore, many other modifications and variations of the presentinvention are possible, and it is to be understood that within the scopeof the disclosed concept, the present invention may be practicedotherwise than as has been specifically described.

FIG. 1 is a block diagram of an image coding apparatus 100 according tothe present invention.

Referring to FIG. 1, the image coding apparatus 100 according to thepresent invention includes a picture division unit 101, a transform unit103, a quantization unit 104, a scanning unit 105, an entropy codingunit 106, an inverse quantization unit 107, an inverse transform unit108, a post-processing unit 110, a picture storing unit 111, an intraprediction unit 112, an inter prediction unit 113, a subtracter 102 andan adder 109.

The picture division unit 101 divides a picture or a slice into aplurality of largest coding units (LCUs), and divides each LCU into oneor more coding units. The picture division unit 101 determinesprediction mode of each coding unit and a size of prediction unit and asize of transform unit.

An LCU includes one or more coding units. The LCU has a recursive quadtree structure to specify a division structure. Information specifyingthe maximum size and the minimum size of the coding unit is included ina sequence parameter set. The division structure is specified by one ormore split coding unit flags (split_cu_flags). The coding unit has asize of 2N×2N.

A coding unit includes one or more prediction units. In intraprediction, the size of the prediction unit is 2N×2N or N×N. In interprediction, the size of the prediction unit is 2N×2N, 2N×N, N×2N or N×N.When the prediction unit is an asymmetric partition in inter prediction,the size of the prediction unit may also be one of hN×2N, (2−h)N×2N,2N×hN and 2N×(2−h)N. The value of h is ½.

A coding unit includes one or more transform units. The transform unithas a recursive quad tree structure to specify a division structure. Thedivision structure is specified by one or more split transform unitflags (split_tu_flags). Information specifying the maximum size and theminimum size of the transform unit is included in a sequence parameterset.

The intra prediction unit 112 determines an intra prediction mode of acurrent prediction unit and generates one or more prediction blocksusing the intra prediction mode. The prediction block has the same sizeof the transform unit. The intra prediction unit 112 generates referencepixels if there are unavailable reference pixels of a current block,filters adaptively the reference pixels of the current block accordingto the size of the current block and the intra prediction mode, andgenerates a prediction block of the current block. The current block hasthe same size of the prediction block.

FIG. 2 is a conceptual diagram illustrating intra prediction modesaccording to the present invention. As shown in FIG. 2, the number ofintra prediction modes is 35. The DC mode and the planar mode arenon-directional intra prediction modes and the others are directionalintra prediction modes.

The inter prediction unit 113 determines motion information of thecurrent prediction unit using one or more reference pictures stored inthe picture storing unit 111, and generates a prediction block of theprediction unit. The motion information includes one or more referencepicture indexes and one or more motion vectors.

The transform unit 103 transforms residual signals generated using anoriginal block and a prediction block to generate a transformed block.The residual signals are transformed in transform units. A transformtype is determined by the prediction mode and the size of the transformunit. The transform type is a DCT-based integer transform or a DST-basedinteger transform.

The quantization unit 104 determines a quantization parameter forquantizing the transformed block. The quantization parameter is aquantization step size. The quantization parameter is determined perquantization unit having a size of coding unit equal to or larger than areference size. The reference size is a minimum size of the quantizationunit. If a size of the coding unit is equal to or larger than theminimum size of the quantization unit, the coding unit becomes thequantization unit. A plurality of coding units may be included in theminimum quantization unit. The minimum size of the quantization unit isone of allowable sizes of the coding unit.

The quantization unit 104 generates a quantization parameter predictorand generates a differential quantization parameter by subtracting thequantization parameter predictor from the quantization parameter. Thedifferential quantization parameter is encoded and transmitted to thedecoder. If there are no residual signals to be transmitted within thecoding unit, the differential quantization parameter of the coding unitmay not be transmitted.

The quantization parameter predictor is generated by using quantizationparameters of neighboring coding units and/or a quantization parameterof previous coding unit.

In one example, the quantization unit 104 sequentially retrieves a leftquantization parameter, an above quantization parameter and an aboveleft quantization parameter in this order, and generates thequantization parameter predictor using one or two available quantizationparameters. For example, an average of the first two availablequantization parameters retrieved in that order is set as thequantization parameter predictor when at least two quantizationparameters are available. When only one quantization parameter isavailable, the available quantization parameter is set as thequantization parameter predictor. The left quantization parameter is aquantization parameter of a left neighboring coding unit. The abovequantization parameter is a quantization parameter of an aboveneighboring coding unit. The above left quantization parameter is aquantization parameter of an above left neighboring coding unit.

In another example, the quantization unit 104 sequentially retrieves aleft quantization parameter, an above quantization parameter and aprevious quantization parameter in this order, and generates thequantization parameter predictor using one or two available quantizationparameters. An average of the first two available quantizationparameters retrieved in that order is set as the quantization parameterpredictor when at least two quantization parameters are available. Whenonly one quantization parameter is available, the available quantizationparameter is set as the quantization parameter predictor. That is, ifboth of the left quantization parameter and the above quantizationparameter are available, the average of the left quantization parameterand the above quantization parameter is set as the quantizationparameter predictor. If one of the left quantization parameter and theabove quantization parameter is available, the average of the availablequantization parameter and the previous quantization parameter is set asthe quantization parameter predictor. If both of the left quantizationparameter and the above quantization parameter are unavailable, theprevious quantization parameter is set as the quantization parameterpredictor. The previous quantization parameter is a quantizationparameter of a previous coding unit in coding order. The average isrounded off.

The quantization unit 104 quantizes the transformed block using aquantization matrix and the quantization parameter to generate aquantized block. The quantized block is provided to the inversequantization unit 107 and the scanning unit 105.

The scanning unit 105 determines a scan pattern and applies the scanpattern to the quantized block. When CABAC (Context adaptive binaryarithmetic coding) is used for entropy coding, the scan pattern isdetermined as follows.

In intra prediction, the distribution of the quantized transformcoefficients varies according to the intra prediction mode and the sizeof the transform unit. Thus, the scan pattern is determined by the intraprediction mode and the size of the transform unit. The scan pattern isselected among a diagonal scan, vertical scan and horizontal scan. Thequantized transform coefficients of the quantized block are split intosignificant flags, coefficient signs and coefficient levels. The scanpattern is applied to the significant flags, coefficient signs andcoefficient levels respectively.

When the size of the transform unit is equal to or smaller than a firstsize, the horizontal scan is selected for the vertical mode and apredetermined number of neighboring intra prediction modes of thevertical mode, the vertical scan is selected for the horizontal mode andthe predetermined number of neighboring intra prediction modes of thehorizontal mode, and the diagonal scan is selected for the other intraprediction modes. The first size is 8×8.

When the size of the transform unit is larger than the first size, thediagonal scan is selected for all intra prediction modes.

In inter prediction, the diagonal scan is used.

When the size of the transform unit is larger than a second size, thequantized block is divided into a plurality of subsets and scanned. Thesecond size is 4×4. The scan pattern for scanning the subsets is thesame as the scan pattern for scanning quantized transform coefficientsof each subset. The quantized transform coefficients of each subset arescanned in the reverse direction. The subsets are also scanned in thereverse direction.

Last non-zero position is encoded and transmitted to the decoder. Thelast non-zero position specifies position of last non-zero quantizedtransform coefficient within the transform unit. Non-zero subset flagsare determined and encoded. The non-zero subset flag indicates whetherthe subset contains non-zero coefficients or not. The non-zero subsetflag is not defined for a subset covering a DC coefficient and a subsetcovering last non-zero coefficient.

The inverse quantization unit 107 inversely quantizes the quantizedtransform coefficients of the quantized block.

The inverse transform unit 108 inversely transforms the inversequantized block to generate residual signals of the spatial domain.

The adder 109 generates a reconstructed block by adding the residualblock and the prediction block.

The post-processing unit 110 performs a deblocking filtering process forremoving blocking artifact generated in a reconstructed picture.

The picture storing unit 111 receives post-processed image from thepost-processing unit 110, and stores the image in picture units. Apicture may be a frame or a field.

The entropy coding unit 106 entropy-codes the one-dimensionalcoefficient information received from the scanning unit 105, intraprediction information received from the intra prediction unit 112,motion information received from the inter prediction unit 113, and soon.

FIG. 3 is a flow chart illustrating a method of encoding quantizationparameter according to the present invention.

A minimum size of the quantization unit is determined (S110). Theminimum size of the quantization unit is equal to a size of LCU or asize of sub-block of LCU. The minimum size of the quantization unit isdetermined per picture.

A quantization parameter is determined (S120). The quantizationparameter is determined per quantization unit. If the size of thecurrent coding unit is equal to or larger than the minimum size of thequantization unit, the current coding unit becomes the quantizationunit. If the minimum quantization unit includes plural coding units, thequantization parameter is determined for the all the coding units withinthe minimum quantization unit.

A quantization parameter predictor is generated (S130). The quantizationparameter predictor is also determined per quantization unit. If thesize of the current coding unit is equal to or larger than the minimumsize of the quantization unit, the quantization parameter for thecurrent coding unit is generated. If the minimum quantization unitincludes a plurality of coding unit, the quantization parameterpredictor for the first coding unit in coding order is determined andused for the remaining coding units within the minimum quantizationunit.

The quantization parameter is generated by using quantization parametersof neighboring coding units and quantization parameter of previouscoding unit.

In one example, a left quantization parameter, an above quantizationparameter and an above left quantization parameter are sequentiallyretrieved in this order, and the quantization parameter predictor isgenerated using one or two available quantization parameters. Forexample, an average of the first two available quantization parametersretrieved in that order is set as the quantization parameter predictorwhen at least two quantization parameters are available. When only onequantization parameter is available, the available quantizationparameter is set as the quantization parameter predictor. The leftquantization parameter is a quantization parameter of a left neighboringcoding unit. The above quantization parameter is a quantizationparameter of an above neighboring coding unit. The above leftquantization parameter is a quantization parameter of an above leftneighboring coding unit.

In another example, a left quantization parameter, an above quantizationparameter and a previous quantization parameter are sequentiallyretrieved in this order, and the quantization parameter predictor isgenerated using one or two available quantization parameters. An averageof the first two available quantization parameters retrieved in thatorder is set as the quantization parameter predictor when at least twoquantization parameters are available. When only one quantizationparameter is available, the available quantization parameter is set asthe quantization parameter predictor. That is, if both of the leftquantization parameter and the above quantization parameter areavailable, the average of the left quantization parameter and the abovequantization parameter is set as the quantization parameter predictor.If one of the left quantization parameter and the above quantizationparameter is available, the average of the available quantizationparameter and the previous quantization parameter is set as thequantization parameter predictor. If both of the left quantizationparameter and the above quantization parameter are unavailable, theprevious quantization parameter is set as the quantization parameterpredictor. The previous quantization parameter is a quantizationparameter of a previous coding unit in coding order. The average isrounded off.

A differential quantization parameter (dQP) is generated by using thequantization parameter of the current coding unit and the quantizationparameter predictor of the current coding unit (S140).

The differential quantization parameter is entropy-coded (S150). The dQPis converted into an absolute value of the dQP and a sign flag indictingthe sign of the dQP. The absolute value of the dQP is binarized astruncated unary. Then, the absolute value and the sign flag arearithmetically coded. If the absolute value is zero, the sign flag doesnot exist.

Meanwhile, the minimum size of the quantization unit is also signaled toa decoding apparatus.

Two steps are required to signal the minimum size of the quantizationunit in the current HM (HEVC Test Model) under construction. Firstly, itis determined whether the quantization parameter is adjusted per LCU orsub-block of LCU in sequence level, and if it is determined that thequantization parameter is adjusted per sub-block of LCU in sequencelevel, then the minimum size of the quantization unit is determined inpicture level. A first parameter (cu_qp_delta_enabled_flag) indicatingwhether the quantization parameter is adjusted per LCU or sub-block ofLCU is included in the SPS (sequence parameter set). If the firstparameter indicates that the quantization parameter is adjusted persub-block of LCU, a second parameter (max_cu_qp_delta-depth) is includedin the PPS (picture parameter set). The second parameter specifies theminimum size of the quantization unit smaller than the size of LCU.Therefore, complexity of coding process increases and two parametershould be transmitted if the minimum size of the quantization unit isused at least one picture.

In the present invention, it is omitted to determine whether the minimumsize of the quantization unit is smaller than the size of LCU or not onsequence level. That is, the minimum size of the quantization unit isdetermined for each picture. Therefore, one parameter (for example,cu_qp_delta_enabled_info) may be used for specifying the minimum size ofthe quantization unit. The parameter specifies depth of the minimumquantization unit. The minimum size of the quantization unit may beequal to a size of LCU or a size of sub-block of LCU. Accordingly, thecoding bits required for signaling the minimum size of the quantizationunit decreases and the complexity of coding process also decreases.

A predetermined quantization matrix and a user-defined quantizationmatrix may be used for quantizing the transformed block. When one ormore user-defined quantization matrices are used, the one or moreuser-defined quantization matrices should be included in the SPS or PPS.To reduce signaling bits of the user-defined quantization matrix, thecoefficients of the user-defined quantization matrix are coded usingDPCM (differential pulse code modulation). A diagonal scan is applied tothe coefficients for DPCM.

When a size of the user-defined quantization matrix is larger than apredetermined size, the coefficients of the user-defined quantizationmatrix are down-sampled to reduce the signaling bits and then codedusing DPCM. The predetermined size may be 8×8. For example, if the sizeof the user-defined quantization matrix is 16×16, coefficients otherthan DC coefficient of the user-defined quantization matrix aredown-sampled using 4:1 down sampling. The DC coefficient is signaledseparately from the down sampled matrix.

FIG. 4 is a block diagram of an image decoding apparatus 200 accordingto the present invention.

The image decoding apparatus 200 according to the present inventionincludes an entropy decoding unit 201, an inverse scanning unit 202, aninverse quantization unit 203, an inverse transform unit 204, an adder205, a post processing unit 206, a picture storing unit 207, an intraprediction unit 208 and an inter prediction unit 209.

The entropy decoding unit 201 extracts the intra prediction information,the inter prediction information and the one-dimensional coefficientinformation from a received bit stream. The entropy decoding unit 201transmits the inter prediction information to the inter prediction unit209, the intra prediction information to the intra prediction unit 208and the coefficient information to the inverse scanning unit 202.

The inverse scanning unit 202 uses an inverse scan pattern to generatetwo dimensional quantized block. It is supposed that CABAC is used asentropy coding method. The inverse scan pattern is one of the diagonalscan, the vertical scan and the horizontal scan.

In intra prediction, the inverse scan pattern is determined by the intraprediction mode and the size of the transform unit. The inverse scanpattern is selected among a diagonal scan, vertical scan and horizontalscan. The selected inverse scan pattern is applied to the significantflags, the coefficient signs and the coefficient levels respectivelygenerate the quantized block.

When the size of the transform unit is equal to or smaller than thefirst size, the horizontal scan is selected for the vertical mode and apredetermined number of neighboring intra prediction modes of thevertical mode, the vertical scan is selected for the horizontal mode andthe predetermined number of neighboring intra prediction modes of thehorizontal mode, and the diagonal scan is selected for the other intraprediction modes. The first size is 8×8.

When the size of the transform unit is larger than the first size, thediagonal scan is selected for all intra prediction modes.

In inter prediction, the diagonal scan is used.

When the size of the transform unit is larger than the second size, thesignificant flags, the coefficient signs and the coefficient levels areinversely scanned in the unit of the subset to generate subsets. And thesubsets are inversely scanned to generate the quantized block. Thesecond size is 4×4.

The inverse scan pattern used for generating each subset is the same asthe inverse scan pattern used for generating the quantized block. Thesignificant flags, the coefficient signs and the coefficient levels arescanned in the reverse direction. The subsets are also scanned in thereverse direction.

The last non-zero position and the non-zero subset flags are receivedfrom the encoder. The last non-zero position is used to determine thenumber of subsets to be generated. The non-zero subset flags are used todetermine the subsets to be generated by applying the inverse scanpattern. The subset covering the DC coefficient and the subset coveringthe last non-zero coefficient are generated using the inverse scanpattern because the non-zero subset flags for a subset covering a DCcoefficient and a subset covering last non-zero coefficient are nottransmitted.

The inverse quantization unit 203 receives the differential quantizationparameter from the entropy decoding unit 201 and generates thequantization parameter predictor. The quantization parameter predictoris generated through the same operation of the quantization unit 104 ofFIG. 1. Then, the inverse quantization unit 203 adds the differentialquantization parameter and the quantization parameter predictor togenerate the quantization parameter of the current coding unit. If thecurrent coding unit is equal to or larger than the minimum quantizationunit and the differential quantization parameter for the current codingunit is not received from the encoder, the differential quantizationparameter is set to 0.

The inverse quantization unit 203 inversely quantizes the quantizedblock.

The inverse transform unit 204 inversely transforms theinverse-quantized block to restore a residual block. The inversetransform type is adaptively determined according to the prediction modeand the size of the transform unit. The inverse transform type is theDCT-based integer transform or the DST-based integer transform.

The intra prediction unit 208 restores the intra prediction mode of thecurrent prediction unit using the received intra prediction information,and generates a prediction block according to the restored intraprediction mode. The size of the prediction block is the same as that ofthe transform unit. The intra prediction unit 208 generates referencepixels if there are unavailable reference pixels of a current block, andfilters adaptively the reference pixels of the current block accordingto the size of the current block and the intra prediction mode. The sizeof the current block is the same as that of the transform unit.

The inter prediction unit 209 restores the motion information of thecurrent prediction unit using the received inter prediction information,and generates a prediction block using the motion information.

The post-processing unit 206 operates the same as the post-processingunit 110 of FIG. 1.

The picture storing unit 207 receives post-processed image from thepost-processing unit 206, and stores the image in picture units. Apicture may be a frame or a field.

The adder 205 adds the restored residual block and a prediction block togenerate a reconstructed block.

FIG. 5 is a flow chart illustrating a method of decoding quantizationparameter according to the present invention.

The minimum size of the quantization unit is derived (S210). Theparameter (cu_qp_delta_enabled_info) specifying the depth of the minimumquantization unit is extracted from PPS. The minimum size of thequantization unit is derived per picture as follows:Log 2(MinQUSize)=Log 2(MaxCUSize)−cu_qp_delta_enabled_infowherein the MinQUSize is the minimum size of the quantization unit, andthe MaxCUSize is the size of LCU.

The differential quantization parameter (dQP) of the current coding unitis restored (S220). The dQP is restored per quantization unit. Forexample, if the size of the current coding unit is equal to or largerthan the minimum size of the quantization unit, the dQP is restored forthe current coding unit. If the current coding unit does not contain anencoded dQP, the dQP is set to zero. If the quantization unit includesplural coding units, a first coding unit containing at least onenon-zero coefficient in the decoding order contains the encoded dQP.

The encoded dQP is arithmetically decoded to generate an absolute valueof the dQP and a sign flag indicting the sign of the dQP. The absolutevalue of the dQP is bin string binarized as truncated unary. Then, thedQP is restored from the bin string of the absolute value and the signflag. If the absolute value is zero, the sign flag does not exist.

The quantization parameter predictor of the current coding unit isgenerated (S230). The quantization parameter predictor is generatedusing the same operation of step 130 of FIG. 3. If a quantization unitincludes plural coding units, the quantization parameter predictor ofthe first coding unit in the decoding order is generated, and thegenerated quantization parameter predictor is used for all the codingunits within the quantization unit.

The quantization parameter is generated using the dQP and thequantization parameter predictor (S240).

Meanwhile, the user-defined quantization matrices are also restored. Aset of the user-defined quantization matrices is received from theencoding apparatus through the SPS or the PPS. The user-definedquantization matrix is restored using inverse DPCM. The diagonal scan isused for the DPCM. When the size of the user-defined quantization matrixis larger than 8×8, the user-defined quantization matrix is restored byup-sampling the coefficients of the received 8×8 quantization matrix.The DC coefficient of the user-defined quantization matrix is extractedfrom the SPS or the PPS. For example, if the size of the user-definedquantization matrix is 16×16, coefficients of the received 8×8quantization matrix are up-sampled using 1:4 up-sampling.

FIG. 6 is a flow chart illustrating a method of generating a predictionblock in intra prediction according to the present invention.

Intra prediction information of the current prediction unit isentropy-decoded (S310).

The intra prediction information includes a mode group indicator and aprediction mode index. The mode group indicator is a flag indicatingwhether the intra prediction mode of the current prediction unit belongsto a most probable mode group (MPM group). If the flag is 1, the intraprediction unit of the current prediction unit belongs to the MPM group.If the flag is 0, the intra prediction unit of the current predictionunit belongs to a residual mode group. The residual mode group includesall intra prediction modes other than the intra prediction modesbelonging to the MPM group. The prediction mode index specifies theintra prediction mode of the current prediction unit within the groupspecified by the mode group indicator.

The intra prediction mode of the current prediction unit is derivedusing the intra prediction information (S320).

FIG. 7 is a flow chart illustrating a procedure of deriving intraprediction mode according to the present invention. The intra predictionmode of the current prediction unit is restored using the followingordered steps.

The MPM group is constructed using intra prediction modes of theneighboring prediction units (S321). The intra prediction modes of theMPM group are adaptively determined by a left intra prediction mode andan above intra prediction mode. The left intra prediction mode is theintra prediction mode of the left neighboring prediction unit, and theabove intra prediction mode is the intra prediction mode of the aboveneighboring prediction unit. The MPM group is comprised of three intraprediction modes.

If the left or above neighboring prediction unit does not exist, theintra prediction mode of the left or above neighboring unit is set asunavailable. For example, if the current prediction unit is located atthe left or upper boundary of a picture, the left or above neighboringprediction unit does not exist. If the left or above neighboring unit islocated within other slice or other tile, the intra prediction mode ofthe left or above neighboring unit is set as unavailable. If the left orabove neighboring unit is inter-coded, the intra prediction mode of theleft or above neighboring unit is set as unavailable. If the aboveneighboring unit is located within other LCU, the intra prediction modeof the left or above neighboring unit is set as unavailable.

When both of the left intra prediction mode and the above intraprediction mode are available and are different each other, the leftintra prediction mode and the above intra prediction mode are includedin the MPM group and one additional intra prediction mode is added tothe MPM group. Index 0 is assigned to one intra prediction mode of smallmode number and index 1 is assigned to the other. Or index 0 is assignedto the left intra prediction mode and index 1 is assigned to the aboveintra prediction mode. The added intra prediction mode is determined bythe left and above intra prediction modes as follows.

If one of the left and above intra prediction modes is a non-directionalmode and the other is a directional mode, the other non-directional modeis added to the MPM group. For example, if the one of the left and aboveintra prediction modes is the DC mode, the planar mode is added to theMPM group. If the one of the left and above intra prediction modes isthe planar mode, the DC mode is added to the MPM group. If both of theleft and above intra prediction modes are non-directional modes, thevertical mode is added to the MPM group. If both of the left and aboveintra prediction modes are directional modes, the DC mode or the planarmode is added to the MPM group.

When only one of the left intra prediction mode and the above intraprediction mode is available, the available intra prediction mode isincluded in the MPM group and two additional intra prediction modes areadded to the MPM group. The added two intra prediction modes aredetermined by the available intra prediction modes as follows.

If the available intra prediction mode is a non-directional mode, theother non-directional mode and the vertical mode are added to the MPMgroup. For example, if the available intra prediction mode is the DCmode, the planar mode and the vertical mode are added to the MPM group.If the available intra prediction mode is the planar mode, the DC modeand the vertical mode are added to the MPM group. If the available intraprediction mode is a directional mode, two non-directional modes (DCmode and planar mode) are added to the MPM group.

When both of the left intra prediction mode and the above intraprediction mode are available and are same each other, the availableintra prediction mode is included in the MPM group and two additionalintra prediction modes are added to the MPM group. The added two intraprediction modes are determined by the available intra prediction modesas follows.

If the available intra prediction mode is a directional mode, twoneighboring directional modes are added to the MPM group. For example,if the available intra prediction mode is the mode 23, the leftneighboring mode (mode 1) and the right neighboring mode (mode 13) areadded to the MPM group. If the available intra prediction mode is themode 30, the two neighboring modes (mode 2 and mode 16) are added to theMPM group. If the available intra prediction mode is a non-directionalmode, the other non-directional mode and the vertical mode are added tothe MPM group. For example, if the available intra prediction mode isthe DC mode, the planar mode and the vertical mode are added to the MPMgroup.

When both of the left intra prediction mode and the above intraprediction mode are unavailable, three additional intra prediction modesare added to the MPM group. The three intra prediction modes are the DCmode, the planar mode and the vertical mode. Indexes 0, 1 and 2 areassigned to the three intra prediction modes in the order of the DCmode, the planar mode and the vertical mode or in the order of theplanar mode, the DC mode and the vertical mode.

It is determined whether the mode group indicator indicates the MPMgroup (S322).

If the mode group indicator indicates the MPM group, the intraprediction of the MPM group specified by the prediction mode index isset as the intra prediction mode of the current prediction unit (S323).

If the mode group indicator does not indicate the MPM group, the intraprediction of the residual mode group specified by the prediction modeindex is set as the intra prediction mode of the current prediction unit(S324). The intra prediction mode of the current unit is derived usingthe prediction mode index and the intra prediction modes of the MPMgroup as the following ordered steps.

Among the three intra prediction modes of the MPM group, the intraprediction mode with lowest mode number is set to a first candidate, theintra prediction mode with middle mode number is set to a secondcandidate, and the intra prediction mode with highest mode number is setto a third candidate.

1) The prediction mode index is compared with the first candidate. Ifthe prediction mode index is equal to or greater than the firstcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

2) The prediction mode index is compared with the second candidate. Ifthe prediction mode index is equal to or greater than the secondcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

3) The prediction mode index is compared with the third candidate. Ifthe prediction mode index is equal to or greater than the thirdcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

4) The value of the final prediction mode index is set as the modenumber of the intra prediction mode of the current prediction unit.

A size of the prediction block is determined based on the transform sizeinformation specifying the size of the transform unit (S330). Thetransform size information may be one or more split_transform_flagsspecifying the size of the transform unit.

If the size of the transform unit is equal to the size of the currentprediction unit, the size of the prediction block is equal to the sizeof the current prediction unit.

If the size of the transform unit is smaller than the size of thecurrent prediction unit, the size of the prediction block is equal tothe size of the transform unit. In this case, a process of generating areconstructed block is performed on each sub-block of the currentprediction unit. That is, a prediction block and a residual block of acurrent sub-block are generated and a reconstructed block of eachsub-block is generated by adding the prediction block and the residualblock. Then, a prediction block, a residual block and a reconstructedblock of the next sub-block in decoding order are generated. Therestored intra prediction mode is used to generate all prediction blocksof all sub-block. Some pixels of the reconstructed block of the currentsub-block are used as reference pixels of the next sub-block. Therefore,it is possible to generate a prediction block which is more similar tothe original sub-block.

Next, it is determined whether all reference pixels of the current blockare available, and reference pixels are generated if one or morereference pixels are unavailable (S340). The current block is thecurrent prediction unit or the current sub-block. The size of thecurrent block is the size of the transform unit.

FIG. 8 is a conceptual diagram illustrating the positions of referencepixels of the current block according to the present invention. As shownin FIG. 8, the reference pixels of the current blocks are comprised ofabove reference pixels located at (x=0, . . . , 2N−1, y=−1), leftreference pixels located at (x=1−, y=0, . . . , 2M−1) and a corner pixellocated at (x=−1, y=−1). N is the width of the current block and M isthe height of the current block.

If reconstructed pixels do not exist at corresponding positions orreconstructed pixels are located within another slice, the referencepixels are set as unavailable. In constrained intra prediction mode (CIPmode), the reconstructed pixels of inter mode are also set asunavailable.

If one or more reference pixels are unavailable, one or more referencepixels are generated for the one or more unavailable reference pixels asfollows.

If all reference pixels are unavailable, the value of 2^(L-1) issubstituted for the values of all the reference pixels. The value of Lis the number of bits used to represent luminance pixel value.

If available reference pixels are located at only one side of theunavailable reference pixel, the value of the reference pixel nearest tothe unavailable pixel is substituted for the unavailable referencepixel.

If available reference pixels are located at both sides of theunavailable reference pixel, the average value of the reference pixelsnearest to the unavailable pixel in each side or the value of thereference pixel nearest to the unavailable pixel in a predetermineddirection is substituted for each unavailable reference pixel.

Next, the reference pixels are adaptively filtered based on the intraprediction mode and the size of the current block (S350). The size ofthe current block is the size of the transform unit.

In the DC mode, the reference pixels are not filtered. In the verticalmode and the horizontal mode, the reference pixels are not filtered. Inthe directional modes other than the vertical and horizontal modes, thereference pixels are adaptively according to the size of the currentblock.

If the size of the current block is 4×4, the reference pixels are notfiltered in all intra prediction modes. For the size 8×8, 16×16 and32×32, the number of intra prediction mode where the reference pixelsare filtered increases as the size of the current block becomes larger.For example, the reference pixels are not filtered in the vertical modeand a predetermined number of neighboring intra prediction mode of thevertical mode. The reference pixels are also not filtered in thehorizontal mode and the predetermined number of neighboring intraprediction mode of the horizontal mode. The predetermined number is oneof 0˜7 and decreases as the size of the current block increases.

Next, a prediction block of the current block is generated using thereference pixels according to the restored intra prediction mode (S360).

In the DC mode, the prediction pixel of the prediction block which isnot adjacent to the reference pixel is generated by averaging the Nreference pixels located at (x=0, . . . N−1, y=−1) and the M referencepixels located at (x=−1, y=0, . . . M−1). The prediction pixel adjacentto the reference pixel is generated using the average value and one ortwo adjacent reference pixels.

In the vertical mode, the prediction pixels which are not adjacent tothe left reference pixel are generated by copying the value of thevertical reference pixel. The prediction pixels which are adjacent tothe left reference pixel are generated by the vertical reference pixeland variance between the corner pixel and the left neighboring pixel.

In the horizontal mode, the prediction pixels are generated using thesame method.

FIG. 9 is a block diagram illustrating an apparatus of generating aprediction block in intra prediction according to the present invention.

The apparatus 300 according to the present invention includes a parsingunit 310, a prediction mode decoding unit 320, a prediction sizedetermining unit 330, a reference availability checking unit 340, areference pixel generating unit 350, a reference pixel filtering unit360 and a prediction block generating unit 370.

The parsing unit 310 restores the intra prediction information of thecurrent prediction unit from the bit stream.

The intra prediction information includes the mode group indicator and aprediction mode index. The mode group indicator is a flag indicatingwhether the intra prediction mode of the current prediction unit belongsto a most probable mode group (MPM group). If the flag is 1, the intraprediction unit of the current prediction unit belongs to the MPM group.If the flag is 0, the intra prediction unit of the current predictionunit belongs to a residual mode group. The residual mode group includesall intra prediction modes other than the intra prediction modesbelonging to the MPM group. The prediction mode index specifies theintra prediction mode of the current prediction unit within the groupspecified by the mode group indicator.

The prediction mode decoding unit 320 includes a MPM group constructingunit 321 and a prediction mode restoring unit 322.

The MPM group constructing unit 321 constructs the MPM group of thecurrent prediction unit. The MPM group is constructed using intraprediction modes of the neighboring prediction units. The intraprediction modes of the MPM group are adaptively determined by a leftintra prediction mode and an above intra prediction mode. The left intraprediction mode is the intra prediction mode of the left neighboringprediction unit, and the above intra prediction mode is the intraprediction mode of the above neighboring prediction unit. The MPM groupis comprised of three intra prediction modes.

The MPM group constructing unit 321 checks the availability of the leftintra prediction mode and the above intra prediction mode. If the leftor above neighboring prediction unit does not exist, the intraprediction mode of the left or above neighboring unit is set asunavailable. For example, if the current prediction unit is located atthe left or upper boundary of a picture, the left or above neighboringprediction unit does not exist. If the left or above neighboring unit islocated within other slice or other tile, the intra prediction mode ofthe left or above neighboring unit is set as unavailable. If the left orabove neighboring unit is inter-coded, the intra prediction mode of theleft or above neighboring unit is set as unavailable. If the aboveneighboring unit is located within other LCU, the intra prediction modeof the left or above neighboring unit is set as unavailable.

The MPM group constructing unit 321 constructs the MPM group as follows.

When both of the left intra prediction mode and the above intraprediction mode are available and are different each other, the leftintra prediction mode and the above intra prediction mode are includedin the MPM group and one additional intra prediction mode is added tothe MPM group. Index 0 is assigned to one intra prediction mode of smallmode number and index 1 is assigned to the other. Or index 0 is assignedto the left intra prediction mode and index 1 is assigned to the aboveintra prediction mode. The added intra prediction mode is determined bythe left and above intra prediction modes as follows.

If one of the left and above intra prediction modes is a non-directionalmode and the other is a directional mode, the other non-directional modeis added to the MPM group. For example, if the one of the left and aboveintra prediction modes is the DC mode, the planar mode is added to theMPM group. If the one of the left and above intra prediction modes isthe planar mode, the DC mode is added to the MPM group. If both of theleft and above intra prediction modes are non-directional modes, thevertical mode is added to the MPM group. If both of the left and aboveintra prediction modes are directional modes, the DC mode or the planarmode is added to the MPM group.

When only one of the left intra prediction mode and the above intraprediction mode is available, the available intra prediction mode isincluded in the MPM group and two additional intra prediction modes areadded to the MPM group. The added two intra prediction modes aredetermined by the available intra prediction modes as follows.

If the available intra prediction mode is a non-directional mode, theother non-directional mode and the vertical mode are added to the MPMgroup. For example, if the available intra prediction mode is the DCmode, the planar mode and the vertical mode are added to the MPM group.If the available intra prediction mode is the planar mode, the DC modeand the vertical mode are added to the MPM group. If the available intraprediction mode is a directional mode, two non-directional modes (DCmode and planar mode) are added to the MPM group.

When both of the left intra prediction mode and the above intraprediction mode are available and are same each other, the availableintra prediction mode is included in the MPM group and two additionalintra prediction modes are added to the MPM group. The added two intraprediction modes are determined by the available intra prediction modesas follows.

If the available intra prediction mode is a directional mode, twoneighboring directional modes are added to the MPM group. For example,if the available intra prediction mode is the mode 23, the leftneighboring mode (mode 1) and the right neighboring mode (mode 13) areadded to the MPM group. If the available intra prediction mode is themode 30, the two neighboring modes (mode 2 and mode 16) are added to theMPM group. If the available intra prediction mode is a non-directionalmode, the other non-directional mode and the vertical mode are added tothe MPM group. For example, if the available intra prediction mode isthe DC mode, the planar mode and the vertical mode are added to the MPMgroup.

When both of the left intra prediction mode and the above intraprediction mode are unavailable, three additional intra prediction modesare added to the MPM group. The three intra prediction modes are the DCmode, the planar mode and the vertical mode. Indexes 0, 1 and 2 areassigned to the three intra prediction modes in the order of the DCmode, the planar mode and the vertical mode or in the order of theplanar mode, the DC mode and the vertical mode.

The prediction mode restoring unit 322 derives the intra prediction modeof the current prediction unit using the mode group indicator and theprediction mode index as follows.

The prediction mode restoring unit 322 determines whether the mode groupindicator indicates the MPM group.

If the mode group indicator indicates the MPM group, the prediction moderestoring unit 322 determines the intra prediction of the MPM groupspecified by the prediction mode index as the intra prediction mode ofthe current prediction unit.

If the mode group indicator does not indicate the MPM group, theprediction mode restoring unit 322 determines the intra prediction ofthe residual mode group specified by the prediction mode index as theintra prediction mode of the current prediction unit. The intraprediction mode of the current unit is derived using the prediction modeindex and the intra prediction modes of the MPM group as the followingordered steps.

Among the three intra prediction modes of the MPM group, the intraprediction mode with lowest mode number is set to a first candidate, theintra prediction mode with middle mode number is set to a secondcandidate, and the intra prediction mode with highest mode number is setto a third candidate.

1) The prediction mode index is compared with the first candidate. Ifthe prediction mode index is equal to or greater than the firstcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

2) The prediction mode index is compared with the second candidate. Ifthe prediction mode index is equal to or greater than the secondcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

3) The prediction mode index is compared with the third candidate. Ifthe prediction mode index is equal to or greater than the thirdcandidate of the MPM group, the value of the prediction mode index isincreased by one. Otherwise, the value of the prediction mode index ismaintained.

4) The value of the final prediction mode index is set as the modenumber of the intra prediction mode of the current prediction unit.

The prediction size determining unit 330 determines the size of theprediction block based on the transform size information specifying thesize of the transform unit. The transform size information may be one ormore split_transform_flags specifying the size of the transform unit.

If the size of the transform unit is equal to the size of the currentprediction unit, the size of the prediction block is equal to the sizeof the current prediction unit.

If the size of the transform unit is smaller than the size of thecurrent prediction unit, the size of the prediction block is equal tothe size of the transform unit. In this case, a process of generating areconstructed block is performed on each sub-block of the currentprediction unit. That is, a prediction block and a residual block of acurrent sub-block are generated and a reconstructed block of eachsub-block is generated by adding the prediction block and the residualblock. Then, a prediction block, a residual block and a reconstructedblock of the next sub-block in decoding order are generated. Therestored intra prediction mode is used to generate all prediction blocksof all sub-block. Some pixels of the reconstructed block of the currentsub-block are used as reference pixels of the next sub-block. Therefore,it is possible to generate a prediction block which is more similar tothe original sub-block.

The reference pixel availability checking unit 340 determines whetherall reference pixels of the current block are available. The currentblock is the current prediction unit or the current sub-block. The sizeof the current block is the size of the transform unit.

The reference pixel generating unit 350 generates reference pixels ifone or more reference pixels of the current block are unavailable.

If all reference pixels are unavailable, the value of 2^(L-1) issubstituted for the values of all the reference pixels. The value of Lis the number of bits used to represent luminance pixel value.

If available reference pixels are located at only one side of theunavailable reference pixel, the value of the reference pixel nearest tothe unavailable pixel is substituted for the unavailable referencepixel.

If available reference pixels are located at both sides of theunavailable reference pixel, the average value of the reference pixelsnearest to the unavailable pixel in each side or the value of thereference pixel nearest to the unavailable pixel in a predetermineddirection is substituted for each unavailable reference pixel.

The reference pixel filtering unit 360 adaptively filters the referencepixels based on the intra prediction mode and the size of the currentblock.

In the DC mode, the reference pixels are not filtered. In the verticalmode and the horizontal mode, the reference pixels are not filtered. Inthe directional modes other than the vertical and horizontal modes, thereference pixels are adaptively according to the size of the currentblock.

If the size of the current block is 4×4, the reference pixels are notfiltered in all intra prediction modes. For the size 8×8, 16×16 and32×32, the number of intra prediction mode where the reference pixelsare filtered increases as the size of the current block becomes larger.For example, the reference pixels are not filtered in the vertical modeand a predetermined number of neighboring intra prediction mode of thevertical mode. The reference pixels are also not filtered in thehorizontal mode and the predetermined number of neighboring intraprediction mode of the horizontal mode. The predetermined number is oneof 0˜7 and decreases as the size of the current block increases.

The prediction block generating unit 370 generates a prediction block ofthe current block using the reference pixels according to the restoredintra prediction mode.

In the DC mode, the prediction pixel of the prediction block which isnot adjacent to the reference pixel is generated by averaging the Nreference pixels located at (x=0, . . . N−1, y=−1) and the M referencepixels located at (x=−1, y=0, . . . M−1). The prediction pixel adjacentto the reference pixel is generated using the average value and one ortwo adjacent reference pixels.

In the vertical mode, the prediction pixels which are not adjacent tothe left reference pixel are generated by copying the value of thevertical reference pixel. The prediction pixels which are adjacent tothe left reference pixel are generated by the vertical reference pixeland variance between the corner pixel and the left neighboring pixel.

In the horizontal mode, the prediction pixels are generated using thesame method.

While the invention has been shown and described with reference tocertain exemplary embodiments thereof, it will be understood by thoseskilled in the art that various changes in form and details may be madetherein without departing from the spirit and scope of the invention asdefined by the appended claims.

What is claimed is:
 1. A method of inversely quantizing a quantizedblock, the method comprising: restoring a differential quantizationparameter; generating a quantization parameter predictor; generating aquantization parameter using the differential quantization parameter andthe quantization parameter predictor; and inversely quantizing thequantized block using the quantization parameter and a quantizationmatrix, wherein the differential quantization parameter is restoredusing a bin string indicating an absolute value of the differentialquantization parameter and a bin indicating a sign of the differentialquantization parameter, if two or more quantization parameters areavailable among a left quantization parameter, an above quantizationparameter and a previous quantization parameter of a current codingunit, the quantization parameter predictor is generated using twoavailable quantization parameters determined according to apredetermined order, the quantization parameter is restored perquantization unit, and a minimum size of the quantization unit isadjusted by a picture parameter set, if the quantization matrix is auser-defined quantization matrix, the quantization matrix is restored byusing an inverse DPCM (differential pulse code modulation), and thequantized block is generated by inversely scanning significant flags,coefficient signs and coefficient levels according to an inverse scanpattern which is selected based on an intra prediction mode and a sizeof a transform unit.
 2. The method of claim 1, wherein if only onequantization parameter is available, the available quantizationparameter is set as the quantization parameter predictor.
 3. The methodof claim 1, wherein the predetermined order is an order of the leftquantization parameter, the above quantization parameter and theprevious quantization parameter.
 4. The method of claim 1, wherein thesize of the quantization unit is derived using a size of a LargestCoding Unit (LCU) and a parameter specifying depth of the minimum sizeof the quantization unit.
 5. The method of claim 1, wherein if the leftand above quantization parameters are available, an average of the leftand above quantization parameters is set as the quantization parameterpredictor.
 6. The method of claim 1, wherein if the left quantizationparameter is not available, an average of the above quantizationparameter and the previous quantization parameter is set as thequantization parameter predictor.
 7. The method of claim 1, wherein ifthe quantization matrix is larger than the restored quantization matrix,the quantization matrix is generated by up-sampling the restoredquantization matrix.
 8. The method of claim 7, wherein a DC coefficientof the quantization matrix is restored separately from AC coefficientsof the quantization matrix.